package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import server.ServerSSLConnection;

import client.ClientRSAConnection;


public class Reiter1ButtonListener implements ActionListener {
	private MainFrame frame;
	
	public Reiter1ButtonListener(MainFrame frame) {
		this.frame = frame;
	}
	@Override
	public void actionPerformed(ActionEvent arg0) {
		if(arg0.getSource() instanceof JButton) {
			JButton button = (JButton) arg0.getSource();
			
			if(button.getText().equals("Verbinden")) {
				ClientRSAConnection rsaConn = new ClientRSAConnection();
				rsaConn.authenticate(frame.reiter1HostField.getIP(), frame.reiter1UsernameField.getText(), 
						ServerSSLConnection.HashPw(frame.reiter1PWField.getText()));
			}
		}
	}
}
